package com.phpxiu.app.view.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;

import com.phpxiu.app.kkylive.R;

/**
 * 聊天列表，会话操作菜单
 * Created by 吴金洲 on 2016/7/28
 */
@Deprecated
public class C2CListOperaMenus extends Dialog implements View.OnClickListener {
    private String mPeer;
    private C2CListMenusOptionsCallBack deleteCallBack;

    public C2CListOperaMenus(Context context) {
        super(context, R.style.menusDialog);
        init(context);
    }

    private void init(Context context){
        setContentView(R.layout.c2c_list_opera_menus);
        findViewById(R.id.base_view).setOnClickListener(this);
        findViewById(R.id.delete).setOnClickListener(this);
        findViewById(R.id.cancel).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.delete:
                if(deleteCallBack!=null){
                    deleteCallBack.onDeleteConversation(mPeer);
                }
                dismiss();
                break;
            case R.id.cancel:
                dismiss();
                break;
            case R.id.base_view:
                dismiss();
                break;
            default:
                break;
        }
    }

    public void setDeleteCallBack(C2CListMenusOptionsCallBack deleteCallBack) {
        this.deleteCallBack = deleteCallBack;
    }

    public void show(String peer) {
        mPeer=peer;
        super.show();
    }

    /**
     * 对话框操作接口
     */
    public interface C2CListMenusOptionsCallBack{
        void onDeleteConversation(String peer);
    }
}
